//
//  AGoodProductTableViewCell.m
//  DistributorAB
//
//  Created by 主事丫环 on 2019/9/26.
//  Copyright © 2019 主事丫环. All rights reserved.
//

#import "AGoodProductTableViewCell.h"

@implementation AGoodProductTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setFrame:(CGRect)frame{
    frame.origin.x += 10;
    //frame.origin.y += 10;
    frame.size.height -= 10;
    frame.size.width -= 20;
    [super setFrame:frame];
}

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        UIView *bottomV = [[UIView alloc] init];
        bottomV.frame = CGRectMake(0, 0, KWIDTH - 20, 332);
        bottomV.layer.cornerRadius = 10;
        bottomV.layer.masksToBounds = YES;
        [self.contentView addSubview:bottomV];
        
        UIImageView *topBgImg = [[UIImageView alloc] init];
        topBgImg.frame = CGRectMake(0, 10, KWIDTH-20, 228);
        [topBgImg setImage:imgname(@"联合 11")];
        [bottomV addSubview:topBgImg];
        
        UIImageView *goodImg = [[UIImageView alloc] init];
        goodImg.frame = CGRectMake(20, 20, KWIDTH-60, 172);
        goodImg.backgroundColor = [UIColor colorWithHexString:@"#F2F2F2"];
        [goodImg setImage:imgname(@"")];
        [topBgImg addSubview:goodImg];
        self.goodImg = goodImg;
        
        UIImageView *bottomBgImg = [[UIImageView alloc] init];
        bottomBgImg.frame = CGRectMake(0, topBgImg.bottom, KWIDTH-20, 100);
        [bottomBgImg setImage:imgname(@"矩形 3218")];
        [bottomV addSubview:bottomBgImg];
        
        UILabel *proTitLab = [[UILabel alloc] init];
        proTitLab.frame = CGRectMake(20, 10, KWIDTH -60, 42);
        proTitLab.numberOfLines = 0;
        proTitLab.font = FontSize(16);
        proTitLab.textColor = K666666;
        [bottomBgImg addSubview:proTitLab];
        self.proTitLab = proTitLab;
        
        UILabel *numTitLab = [[UILabel alloc] init];
        numTitLab.frame = CGRectMake(bottomBgImg.right-93-20, proTitLab.bottom, 93, 20);
        numTitLab.textAlignment = NSTextAlignmentRight;
        numTitLab.font = FontSize(14);
        numTitLab.textColor = [UIColor colorWithHexString:@"#777777"];
        [bottomBgImg addSubview:numTitLab];
        self.numTitLab = numTitLab;
        
        UIImageView *hbspdgImg = [[UIImageView alloc] init];
        hbspdgImg.frame = CGRectMake(bottomBgImg.right-93-20, numTitLab.bottom, 93, 22);
        [hbspdgImg setImage:imgname(@"组 3596")];
        [bottomBgImg addSubview:hbspdgImg];
        
    }
    return self;
}

@end
